package com.around;


public class Student {
    private String name;
    private int age;

    public Student(){
        System.out.println("无参构造方法");
    }
    public Student(String name){
        this.name = name;
    }
    public Student(String name, int age){this.name = name; this.age = age;}
    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return this.name;
    }

    public int getAge() {
        return this.age;
    }

    public void setAge(int age) {
        if (age < 0 || age > 120) {
            System.out.println("年龄有误");
        } else {
            this.age = age;
        }

    }

//    public void study() {
//        System.out.println("学习");
//    }
//
//    public void doHomework() {
//        System.out.println("写作业");
//    }
//
    public void show() {
        System.out.println(name + "," + age);
    }
}
